using System.Collections;
using UnityEngine;

public class EnergeBall : MonoBehaviour
{
	public Rigidbody2D rb;

	public Collider2D col;

	public AttackInfo SCRT_AttackInfo;

	public void Init(float[] data)
	{
		rb.velocity = new Vector2(data[0], data[1]);
		SCRT_AttackInfo.weaponID = 0;
		SCRT_AttackInfo.power = (int)data[2];
		SCRT_AttackInfo.force = rb.velocity;
		StartCoroutine(Show());
	}

	private IEnumerator Show()
	{
		for (float f = 0f; f < 3f; f += 0.5f)
		{
			col.enabled = false;
			col.enabled = true;
			yield return new WaitForSeconds(0.5f);
		}
		base.gameObject.SetActive(false);
	}
}
